#! /usr/bin/python3
# coding=utf-8
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Author: senlin
# Create: 2022-1-19
# ******************************************************************************/


import argparse
import os
import re
import json
from all_commands import AllCommands
from src.libs.logger import logger

PVD = AllCommands()


if __name__ == "__main__":
    # # ================. 基于primary.xml生成src_bin的映射表
    repo_url = 'http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP4/rc5_openeuler-2024-06-26-13-50-33/'
    branch = 'openEuler-22.03-LTS-SP4'
    repos = [
        {   
            "name": "everything",
            "repodata_path": '/'.join([repo_url, 'source', 'repodata']),
            "arch": "src"
            },
        {
            "name": "baseos",
            "repodata_path": '/'.join([repo_url, 'OS', 'aarch64', 'repodata']),
            "arch": "aarch64"
            },
        {
            "name": "epol_main",
            "repodata_path": '/'.join([repo_url, 'EPOL', 'main', 'source', 'repodata']),
            "arch": "src"
            },
        {
            "name": "multi-version_OpenStack-Train",
            "repodata_path": '/'.join([repo_url, 'EPOL', 'multi_version', 'OpenStack', 'Train', 'source', 'repodata']),
            "arch": "src"
            },
        {
            "name": "multi-version_OpenStack-Wallaby",
            "repodata_path": '/'.join([repo_url, 'EPOL', 'multi_version', 'OpenStack', 'Wallaby', 'source', 'repodata']),
            "arch": "src"
            },
        {
            "name": "multi-version_lustre-2.15",
            "repodata_path": '/'.join([repo_url, 'EPOL', 'multi_version', 'lustre', '2.15', 'source', 'repodata']),
            "arch": "src"
            }
    ]
    PVD.process_load_src_bin_repodata(repos, branch)
